//
//  UITableViewRowAction+Index.m
//  Demo
//
//  Created by lc4y on 2017/11/5.
//  Copyright © 2017年 lc4y. All rights reserved.
//

#import "UITableViewRowAction+Index.h"
#import <objc/runtime.h>

static char *RowActionKey = "RowActionKey";

@implementation UITableViewRowAction (Index)

-(void)setIndex:(NSInteger)index {

    objc_setAssociatedObject(self, RowActionKey, @(index), OBJC_ASSOCIATION_COPY_NONATOMIC);
}

-(NSInteger)index {
    
    return [objc_getAssociatedObject(self, RowActionKey) integerValue];
}

@end
